import React from 'react'
import { StyleSheet, View, Image } from 'react-native'

import PropTypes from 'prop-types'

export default class SBSearchIcon extends React.Component {
  constructor(props) {
    super(props)
  }

  render() {
    const { style, source, iconStyle } = this.props
    const mainStyle = [styles.container].concat(style)
    const imageStyle = [styles.iconStyle].concat(iconStyle)
    return (
      <View style={mainStyle}>
        <Image style={imageStyle} source={source} />
      </View>
    )
  }
}

const styles = StyleSheet.create({
  container: {
    width: 38,
    height: '100%',
    display: 'flex',
    justifyContent: 'center',
    alignItems: 'center',
  },
  iconStyle: {
    width: 18,
    height: 18,
  }
})

SBSearchIcon.propTypes = {
  source: PropTypes.any,
  iconStyle: PropTypes.any,
}

SBSearchIcon.defaultProps = {
  source: require('../resources/images/AWB.png'),
  iconStyle: {}
}